<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团办公自动化协作平台</title>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath%>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/ext-all.js"></script>
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/system/selectusercheck.js"></script>
		
		<script type="text/javascript">
			function test(){	
			    initselectusercheck();    
			}
			
			var i =0
			$(function(){
				$.ajaxSetup({
				  async: false
				  }); 
				$(".s09 >a").attr("href","javascript:formSubmit()");
				$(".s10 >a").attr("href","javascript:back()");
			});
			function valName(){
				var name = $.trim($("input[name='name']").attr('value'));
				var start = true;
				$.get("<%=basePath%>tjsinfo/tjsoa/vote/validate.do",{name:name},function(name){
					if(name == 'false'){
						start = false;
						Ext.MessageBox.alert('提示信息', '表头名称已存在！',function(){
							$("input[name='name']").select();	
						});
					}
				});	
				return start;
			}
			function back(){
				window.location.href="<%=basePath%>tjsinfo/tjsoa/vote/headList.do";
			}
			function formSubmit(){
				if(isnull("input[name='name']","表头名称不得为空！")
				&&isnull("input[name='voteName']","投票人不得为空！"))
				{
					//var start = valName();
					
					var start = true;
					if(start == true)
					{
					   msg();
					   form1.submit();
					   //$("form[name='form1']").submit();
					}
				}	
			}						
	    </script>
		<style>
			#right .contabwd_02 {
				width: 99%;
				margin-top: 6px;
				border: 1px #9DB0BC solid;
				background: #fff;
				height: 99%;
				float: left;
			}
		</style>
	</head>
	
	<body onload="test();">
		<form action="<%=basePath%>tjsinfo/tjsoa/vote/headAdd.do" method="post" name="form1">
			<div style="height: 98%">
				<div id="right">
					<div class="p_01">
						<ul>
							<li class="s09">
								<a href="#">提交</a>
							</li>
							<li class="s10">
								<a href="#">返回</a>
							</li>
						</ul>
					</div>

					<table width="100%" border="0" cellspacing="0" cellpadding="0"
						style="height: 93%">
						<tr>
							<td width="100%" valign="top" height="100%">
								<div class="contabwd_02">
									<table width="100%" border="0" cellspacing="0"
										style="margin-top: 8px">
										<tr>
											<td width="11%" align="right">
												年度：
											</td>
											<td colspan="3">
												<select name="yearTime" id="yearTime">
													<%
														Date date = new Date();
														int year = 2000;
														while (year <= 2030) {
													%>
													<option value="<%=year%>"><%=year%>年
													</option>
													<%
														year++;
														}
													%>
												</select>
											</td>
										</tr>
										<tr>
											<td width="11%" align="right">
												表头名称：
											</td>
											<td colspan="3">
												<input name="name" type="text" id="name" size="80" maxlength="200" />
											</td>
										</tr>
										<tr>
											<td align="right">
												备注：
											</td>
											<td colspan="3">
												<textarea name="remark" id="remark" cols="59" rows="8"></textarea>
											</td>
										</tr>
										<tr>
											<td align="right" width="11%">
												投票人：
											</td>
											<td colspan="5">
												<input name="voteName" type="text" id="voteName" size="35" readonly="readonly"/>
												<input type="hidden" name="voteId" id="voteId" />
												<input type="hidden" name="recipientDeptid" id="recipientDeptid" />
												<a href="javascript:void(0)" onclick="selectusercheckwinshow('voteId','voteName','recipientDeptid')"><img src="<%=basePath %>images/yhglgd.gif" /></a>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<input type="hidden" id="basePath" value="<%=basePath%>" />
		</form>
	</body>
</html>
